<?php

namespace App\Services\MakeGoldChargeOrder;

use App\Http\Controllers\Api\V1\Requests\FormRequest;

class MakeGoldChargeOrderRequest extends FormRequest
{
	public function rules(): array
	{
		if (! $this->user()->pay_code) {
			fail('请先设置交易密码');
		}

		return [
			'amount' => [
				'required',
				'numeric',
				'min:1',
			]
		];
	}

	public function attributes(): array
	{
		return ['amount' => '充值额度'];
	}
}
